package lee.vioson.ebook.ui.components

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.material3.Button
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import lee.vioson.ebook.R
import lee.vioson.ebook.ui.AppDestinations
import lee.vioson.ebook.ui.AppTheme

/**
 *Author:viosonlee
 *Date:2023/6/3
 *DESCRIPTION:
 */
@Composable
fun VipGuide(modifier: Modifier = Modifier, navHostController: NavHostController) {
    Box(modifier = modifier) {
        Row(
            modifier = Modifier
                .fillMaxSize()
                .border(
                    width = 1.dp,
                    color = AppTheme.appColors.vipColorText,
                    shape = RoundedCornerShape(size = 4.dp)
                )
                .padding(16.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Column(modifier = Modifier.weight(1f)) {
                Text(
                    text = stringResource(id = R.string.VIP_Membership),
                    style = TextStyle(
                        color = AppTheme.appColors.vipColorText, fontSize = 18.sp,
                        fontWeight = FontWeight.Medium
                    )
                )
                Text(
                    text = stringResource(id = R.string.vip_promotion),
                    style = TextStyle(
                        color = AppTheme.appColors.vipColorText,
                        fontSize = 12.sp
                    )
                )
            }
            Button(
                shape = RoundedCornerShape(size = 8.dp),
                colors = AppTheme.vipButtonColors(),
                onClick = {
                    //to buy vip
                    navHostController.navigate(AppDestinations.VIP_SCREEN)
                }) {
                Text(text = stringResource(id = R.string.Start))
            }
        }
    }
}